<template>
	<view>
		<mumu-get-qrcode @success='qrcodeSucess' @error="qrcodeError"></mumu-get-qrcode>
		<!-- <tn-button @click="CESHI">CESHI</tn-button> -->
	</view>
</template>

<script>
	import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue'

	export default {
		name: "scan",
		components: {
			mumuGetQrcode
		},
		data() {
			return {

			};
		},
		onShow() {


		},
		methods: {
			// CESHI(){
			// 	console.log('扫码事件触发')
			// 	uni.$emit('scan',Math.floor(Math.random() * 100) +1)
			// 	uni.navigateBack({});
			// },
			qrcodeSucess(data) {
				console.log('扫码事件触发')
				uni.$emit('scan', data)
				uni.navigateBack({});

			},
			qrcodeError(err) {

				uni.showModal({
					title: '摄像头授权失败',
					content: '摄像头授权失败，请检测当前浏览器是否有摄像头权限。',
					success: () => {
						uni.navigateBack({})
					}
				})
			}
		}
	}
</script>

<style>

</style>